<%@ page language="java" import="java.util.*,StudentScore.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>录入体育成绩</title>
</head>
<body>
	<p>学生体育成绩录入</p>
		<tr>
		<td><input type="text" id="a" name="a" value="学号" readonly="true"></td>
		<td><input type="text" id="b" name="b" value="姓名" readonly="true"></td>
		<td><input type="text" id="c" name="c" value="成绩" readonly="true"></td>
		</tr>
		<%
		StudentDao student = new StudentDaoJDBC();
    	List<Student> studentList=student.findAllStudent();
		for(Student e:studentList)
		{
			String score=String.valueOf(e.getSport());
			//out.println(score);
		%>
		<form name="postForm" action="EnterStudentSportScore.jsp" " method="post">
		<tr>
			<td><input type="text" id="a" name="stuno"
				value=<%=e.getStuno()%> readonly="true"></td>
		    <td><input type="text" id="stuname" name="stuname"
				value=<%=e.getName() %> readonly="true"></td>

		</tr>
		<%
		String stscore =request.getParameter("stuscore"); 
		String stno =request.getParameter("stuno");
		StudentDao sdao=new StudentDaoJDBC();
		int s = sdao.addStudentScore(stno,"sport",stscore);
		Student stu=sdao.findBystuno(e.getStuno());
		double sport=stu.getSport();
		double score1=e.getMath()+sport+e.getJava();
		String stuno =String.valueOf(e.getStuno());
		String score2=String.valueOf(score1);
		int s1 = sdao.addStudentScore(stuno,"allscore",score2);
		%>
		<td><input type="text" id="stuscore" name="stuscore"
				value=<%=sport%>></td>
		<input type="submit" value="确认" /><br>
		</form>
		<% 
    	  }
    	   %>
    <form name="fm" method="post">
    	   <p><input type="button" name="btn2" onclick="document.fm.action='MenuCourse.jsp';document.fm.submit();"
value="提交成绩"/></p>
</body>
</html>